package factory.headfirst.simplefactory;

import factory.headfirst.Pizza;
import factory.headfirst.PizzaFactory;

public class PizzaStore {
	private PizzaFactory factory;

	public PizzaStore(PizzaFactory factory) {
		super();
		this.factory = factory;
	}

	public Pizza orderPizza(String type) {
		Pizza pizza = factory.createPizza(type);

		pizza.prepare();
		pizza.bake();
		pizza.cut();
		pizza.box();

		return pizza;
	}

}
